<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .title {
            width: 200px;
            height: 50px;
            margin: auto;
        }

        q {
            text-decoration: none;
            color: #111;
        }

        .newpapar li {
            width: 200px;
            height: 35px;
            line-height: 35px;
            margin: auto;
            position: relative;
            counter-increment: item-counter;
            list-style: none;
        }

        .newpapar li:after {
            display: block;
            position: absolute;
            width: 24px;
            top: 4px;
            left: -25px;
            line-height: 24px;
            text-align: center;
            color: #f00;
            content: counter(item-counter);
        }
    </style>
</head>

<body>
    <div class="warp"></div>
    <div class="title">
        <span id="hot"><a href="#">热搜</a></span>
        <span id="change"><a href="#">换一换</a></span>
    </div>
    <ul class="newpapar">
        <!-- <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li> -->
    </ul>
</body>

</html>
<script>
    var newpapar = document.querySelector(".newpapar")
    var change = document.getElementsById("change")
    let arr = [
        "ssssssssssss",
        "ssssssssssss",
        "ssssssssssss",
        "ssssssssssss",
        "ssssssssssss",
        "ssssssssssss",
        "aaaaaaaaaaaa",
        "aaaaaaaaaaaa",
        "aaaaaaaaaaaa",
        "aaaaaaaaaaaa",
        "aaaaaaaaaaaa",
        "aaaaaaaaaaaa",
        "bbbbbbbbbbbb",
        "bbbbbbbbbbbb",
        "bbbbbbbbbbbb",
        "bbbbbbbbbbbb",
        "bbbbbbbbbbbb",
        "bbbbbbbbbbbb",
        "cccccccccccc",
        "cccccccccccc",
        "cccccccccccc",
        "cccccccccccc",
        "cccccccccccc",
        "cccccccccccc",
        "dddddddddddd",
        "dddddddddddd",
        "dddddddddddd",
        "dddddddddddd",
        "dddddddddddd",
        "dddddddddddd",
        "ffffffffffff",
        "ffffffffffff",
        "ffffffffffff",
        "ffffffffffff",
        "ffffffffffff",
        "ffffffffffff",
    ]

    var page = 1;
    var max = Math.ceil(arr.length / 6);
    var news = [];
    changeNew();

    change.onclick = changeNew;

    function changeNew() {
        if (page > max) {
            page = 1
        }
        news = arr.slice(6 * (page - 1), 6 * page);
        setNews(news);
        page++;
    }
    function setNews(news) {
        let ste = '';
        for (let i = 0; i < news.length; i++) {
            str += `<li><a href="#">${news[i]}</li>`
        }
        newpapar.innerHTML = str
    }
</script>